package com.hqd.ch03.v51.context.validation;

public interface MessageCodesResolver {

    /**
     * Build message codes for the given error code and object name.
     * Used for building the codes list of an ObjectError.
     *
     * @param errorCode  the error code used for rejecting the object
     * @param objectName the name of the object
     * @return the message codes to use
     */
    String[] resolveMessageCodes(String errorCode, String objectName);

    /**
     * Build message codes for the given error code and field specification.
     * Used for building the codes list of an FieldError.
     *
     * @param errorCode  the error code used for rejecting the value
     * @param objectName the name of the object
     * @param field      the field name
     * @param fieldType  the field type (may be {@code null} if not determinable)
     * @return the message codes to use
     */
    String[] resolveMessageCodes(String errorCode, String objectName, String field, Class<?> fieldType);

}
